﻿<%@ Control language="C#" Inherits="eMarketing.GroupManager" CodeFile="GroupManager.ascx.cs" AutoEventWireup="true"%>
<%@ Register Src="../../controls/tm_TreeViewAdv.ascx" TagName="tm_TreeViewAdv" TagPrefix="uc3" %>
<%@ Register Src="../../controls/tm_GroupList.ascx" TagName="tm_GroupList" TagPrefix="uc4" %>
<%@ Register Src="../../controls/tm_GroupList.ascx" TagName="tm_GroupList" TagPrefix="uc2" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<table border="0" width="100%">
    <tr>
        <td align="center">
                        &nbsp;<asp:Label ID="lblMessage" runat="server"></asp:Label></td>
    </tr>
    <tr>
        <td align="center">
            <asp:Panel ID="pnlSearchGroup" runat="server" BorderColor="Black" HorizontalAlign="Center">
                <table border="0" width="600">
                    <tr>
                        <td style="width: 103px">
                        </td>
                        <td style="width: 110px">
                            <asp:Label ID="Label14" runat="server"   Text="Tên nhóm :" CssClass="titletext3"></asp:Label></td>
                        <td>
                            <asp:TextBox ID="tbxGroupName" runat="server" MaxLength="255" Width="150px"></asp:TextBox>
                            <asp:CheckBox ID="cbxGroupName" runat="server"   Text="Tìm chính xác" CssClass="titletext3">
                            </asp:CheckBox ></td>
                    </tr>
                    <tr>
                        <td style="width: 103px">
                        </td>
                        <td style="width: 110px">
                            <asp:Label ID="Label1" runat="server" CssClass="titletext3" Text="Mô tả :"></asp:Label></td>
                        <td>
                            <asp:TextBox ID="tbxDescription" runat="server" MaxLength="255" Width="256px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 103px; height: 24px;">
                        </td>
                        <td style="width: 110px; height: 24px;">
                            <asp:Label ID="Label2" runat="server" CssClass="titletext3" Text="Loại nhóm :"></asp:Label></td>
                        <td style="height: 24px">
                            <asp:DropDownList ID="ddlGroupTypeS" runat="server">
                            </asp:DropDownList></td>
                    </tr>
                    <tr>
                        <td colspan="3">
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="3">
                            <asp:Button id="btnMemberList_Member" Width="90px" runat="server" Text="Tỉm kiếm"   OnClick="btnMemberList_Member_Click1" CssClass="btn"/>
                            <asp:Button id="btnReset" Width="90px" runat="server" Text="Làm lại"   OnClick="btnReset_Click" CssClass="btn"/>
                            <asp:Button id="btnAdd" Width="90px" runat="server" Text="Thêm nhóm" CssClass="btn" OnClick="btnAdd_Click"/></td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="3">
                        <asp:GridView ID="gvGroupList" runat="server" AutoGenerateColumns="False" Width="100%" AllowPaging="True" AllowSorting="True" DataSourceID="dsGroupList" OnPageIndexChanging="gvGroupList_PageIndexChanging" CssClass="table" OnDataBound="gvGroupList_DataBound" OnSorting="gvGroupList_Sorting">
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="ck" runat="server" />
                                    </ItemTemplate>
                                    <ItemStyle Width="10px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="T&#234;n nh&#243;m" SortExpression="groupName">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# GetURL(DataBinder.Eval(Container, "DataItem.groupId").ToString()) %>'><%# DataBinder.Eval(Container, "DataItem.groupName").ToString() %></asp:HyperLink>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="description" HeaderText="M&#244; tả" SortExpression="description" />
                                <asp:BoundField DataField="groupType" HeaderText="Loại" SortExpression="groupType" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Ng&#224;y tạo" SortExpression="createOn">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# ((DateTime)(DataBinder.Eval(Container, "DataItem.createOn"))).ToShortDateString() %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="groupId" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="lblGroupId" runat="server" Text='<%# Bind("groupId") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle HorizontalAlign="Right" />
                        </asp:GridView>
                            <asp:SqlDataSource ID="dsGroupList" runat="server"></asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:CheckBox ID="cbxCheckAll" runat="server"  
                                            Text="Chọn tất cả" AutoPostBack="True" OnCheckedChanged="cbxCheckAll_CheckedChanged" CssClass="titletext3" /></td>
                        <td align="right">
                                        <asp:Button id="btnDeleteGroup" Width="80px" runat="server" Text="Xóa chọn"   OnClick="btnDeleteGroup_Click" CssClass="btn"/></td>
                    </tr>
                </table>
            </asp:Panel>
        </td>
    </tr>
    <tr>
        <td align="center">
            &nbsp;
        </td>
    </tr>
    <tr>
        <td align="center">
            <asp:Panel ID="pnlMemberList" runat="server" Visible="False">
                <table border="0" width="600">
                    <tr>
                        <td colspan="3">
                            <asp:Label ID="Label3" runat="server" Text="Danh sách thành viên nhóm :"></asp:Label>
                            <asp:Label ID="lblGroupName" runat="server" Font-Bold="True" ForeColor="Blue"></asp:Label></td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <asp:GridView ID="gvMemberList" runat="server" AllowPaging="True" AllowSorting="True"
                                AutoGenerateColumns="False" CssClass="table" DataSourceID="dtsMemberList" OnDataBound="gvMemberList_DataBound" Width="100%" OnSorting="gvMemberList_Sorting">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="ckMember" runat="server" />
                                        </ItemTemplate>
                                        <ItemStyle Width="10px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="T&#224;i khoản" SortExpression="account">
                                        <ItemTemplate>
                                            <asp:Label ID="Label17" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.account").ToString() %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="T&#234;n/Đơn vị" SortExpression="name1">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# getEnterpriseURL(DataBinder.Eval(Container, "DataItem.userId").ToString()) %>'><%# DataBinder.Eval(Container, "DataItem.name1").ToString() %></asp:HyperLink>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Ng&#224;y th&#234;m" SortExpression="createOn">
                                        <ItemTemplate>
                                            <asp:Label ID="Label18" runat="server" Text='<%# ((DateTime)DataBinder.Eval(Container, "DataItem.createOn")).ToShortDateString() %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="id" Visible="False">
                                        <ItemTemplate>
                                            <asp:Label ID="lblID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="userId" Visible="False">
                                        <ItemTemplate>
                                            <asp:Label ID="lblUserId" runat="server" Text='<%# Bind("userId") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <PagerStyle HorizontalAlign="Right" />
                            </asp:GridView>
                            <asp:SqlDataSource ID="dtsMemberList" runat="server"></asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 157px; height: 26px;">
                            <asp:CheckBox ID="chkCheckAllMember" runat="server" AutoPostBack="True" CssClass="titletext3"
                                OnCheckedChanged="ckMemberList_SelectedAll_CheckedChanged" Text="Chọn tất cả" /></td>
                        <td style="height: 26px">
                        </td>
                        <td align="right" style="height: 26px">
                            <asp:Button ID="btnDeleteMember" runat="server" CssClass="btn" 
                                Text="Xóa chọn" Width="80px" OnClick="btnDeleteMember_Click" /></td>
                    </tr>
                    <tr>
                        <td colspan="3" style="height: 21px">
                            &nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="3" style="height: 21px">
                            <asp:Label ID="lblAddMemberMes" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td align="center" colspan="3" style="height: 21px">
                            <asp:Panel ID="pnlAddToGroup" runat="server" Visible="False">
                            <table border="0">
                                <tr>
                                    <td style="height: 21px">
                                        <uc4:tm_GroupList ID="tm_GroupList_MemberList" runat="server" />
                                        </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <asp:Button ID="btnMemberList_Add" runat="server"   Text="Thêm" Width="80px" OnClick="btnMemberList_Add_Click" CssClass="btn" />
                                        <asp:Button ID="btnMemberList_Cancel" runat="server"   Text="Thoát" Width="80px" OnClick="btnMemberList_Cancel_Click" CssClass="btn" /></td>
                                </tr>
                            </table>
                            </asp:Panel>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </td>
    </tr>
    <tr>
        <td align="center">
            <asp:Panel ID="pnlAddGroup" runat="server" BorderColor="Black" HorizontalAlign="Center" Visible="False">
                <table border="0" width="600">
                    <tr>
                        <td style="width:125px; padding-left: 10px;">
                            <asp:Label ID="Label9" runat="server"   Text="Tài khoản :" CssClass="titletext3"></asp:Label></td>                    
                        <td>
                            <asp:TextBox ID="txtAccount" runat="server" MaxLength="255" ReadOnly="True"></asp:TextBox>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left: 10px; width: 125px">
                            <asp:Label ID="Label13" runat="server"
                                  Text="Loại nhóm:" CssClass="titletext3"></asp:Label></td>
                        <td>
                            <asp:DropDownList ID="ddlGroupType" runat="server">
                                </asp:DropDownList></td>
                    </tr>
                    <tr>
                        <td style="width:125px; padding-left: 10px;">
                            <asp:Label ID="Label10" runat="server"   Text="Tên nhóm :" CssClass="titletext3"></asp:Label><asp:Label ID="Label15" runat="server" Font-Bold="True" ForeColor="Red" Text="*"></asp:Label></td>                    
                        <td>
                            <asp:TextBox ID="txtGroupName" runat="server" MaxLength="15"></asp:TextBox>
                            </td>
                    </tr>
                    <tr>
                        <td style="width:125px; padding-left: 10px;" valign="top">
                            <asp:Label ID="Label11" runat="server"   Text="Mô tả nhóm :" CssClass="titletext3"></asp:Label></td>                    
                        <td>
                            <asp:TextBox ID="txtGroupDescription" runat="server" MaxLength="255" Rows="4" TextMode="MultiLine"
                                Width="350px"></asp:TextBox>&nbsp;
                                                                            
                                    </td>
                    </tr>
                    <tr>
                        <td style="width: 125px; padding-left: 10px;" valign="top">
                            <asp:Label ID="Label12" runat="server"   Text="Lãnh vực :" CssClass="titletext3"></asp:Label></td>
                        <td>
                            <uc3:tm_TreeViewAdv ID="tvProductCat" runat="server" myHeight="200" myWidth="350" />
                            
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 125px" valign="top">
                        </td>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <asp:CheckBox ID="ckSendToSeller" runat="server"   Text="Gửi đến các thành viên người mua" CssClass="titletext3" /></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:CheckBox ID="ckSendToBuyer" runat="server"   Text="Gửi đến các thành viên người bán" CssClass="titletext3" /></td>
                                </tr>
                                <tr>
                                    <td style="height: 20px">
                                        <asp:CheckBox ID="ckSendToVendor" runat="server"   Text="Gửi đến các thành viên doanh nghiệp" CssClass="titletext3" /></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 125px" valign="top">
                        </td>
                        <td style="height: 10px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 125px" valign="top">
                        </td>
                        <td>
                            <table border="0" cellpadding="2" cellspacing="0" width="100%">
                                <tr>
                                    <td style="height: 28px"><asp:Button id="btnAddGroupSave" Width="80px" runat="server" Text="Lưu"   OnClick="btnAddGroupSave_Click" ValidationGroup="add" CssClass="btn"/>
                                        <asp:Button ID="btnAddGroupCancel" runat="server"   Text="Thoát" Width="80px" OnClick="btnAddGroupCancel_Click" CssClass="btn" /></td>
                                </tr>
                                <tr>
                                    <td style="height: 28px">
                                        </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 10px" valign="top">
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>            
            </asp:Panel>
        </td>
    </tr>
</table>

